import { createApp } from 'vue'

import App from './App.vue'

const app = createApp(App)

// 懒加载插件
import 'lazysizes'
import 'v3-infinite-loading/lib/style.css'

/* Store */
import { createPinia } from 'pinia'
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
const pinia = createPinia()
pinia.use(piniaPluginPersistedstate)

/* router */
import './router/guard'
/* 样式 */
import './styles/index.less'
import 'vue3-colorpicker/style.css' //vue3取色器组件样式
import 'virtual:uno.css' //uno.css

// vue-request配置
import { setGlobalOptions } from 'vue-request'

import router from './router/index'
setGlobalOptions({
  manual: true,
  throttleInterval: 300
  // ...
})
// dayjs
import 'dayjs/locale/zh-cn'

import dayjs from 'dayjs'
dayjs.locale('zh-cn')

// 虚拟滚动列表组件
import 'vue-virtual-scroller/dist/vue-virtual-scroller.css' //虚拟滚动列表组件样式

import VueVirtualScroller from 'vue-virtual-scroller'
app.use(VueVirtualScroller)

// 自定义指令
import directives from './directives'

app.use(pinia).use(router).use(directives).mount('#app')
